package com.hhcf.service.impl;

import java.math.BigDecimal;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hhcf.dao.ZxbCouponMgDao;
import com.hhcf.entity.ZxbCouponMgEntity;
import com.hhcf.service.ZxbRegistryService;

/**
 * 
 * @ClassName: TestRegistryServiceImpl
 * @Description:
 * @author: zhaotf
 * @date: 2017年2月19日 下午2:28:13
 */
@Service("zxbRegistryService")
@Transactional
public class ZxbRegistryServiceImpl implements ZxbRegistryService {

	@Autowired
	private ZxbCouponMgDao zxbCouponMgDao;

	/**
	 * 
	 * Description:
	 * 
	 * @param name
	 * @return
	 * @see com.hhcf.service.ZxbRegistryService#hello(java.lang.String)
	 */
	public String hello(String name) {
		return "dubbo 服务端-3测试，hello " + name;
	}

	@Override
	public Object setDate(String name) {
		System.out.println("ZxbRegistryServiceImpl.setDate:" + name);

		ZxbCouponMgEntity entity = new ZxbCouponMgEntity();
		entity.setCoupontitle("dubbo测试");
		entity.setUserid(name);
		entity.setDeadtime(new Date());
		entity.setEnableprotype("0");
		entity.setGettime(new Date());
		entity.setId(name);
		entity.setMininvest(BigDecimal.ZERO);
		entity.setMoney(BigDecimal.ZERO);
		entity.setRate(BigDecimal.ZERO);
		entity.setType("0");
		entity.setStatus("0");

		zxbCouponMgDao.save(entity);
		return entity;
	}

}
